﻿using System;
using UnityEngine;
using UnityEngine.UI;

// Token: 0x020003A7 RID: 935
[RequireComponent(typeof(Button))]
public class ItemChangeButton : MonoBehaviour
{
	// Token: 0x17000242 RID: 578
	// (get) Token: 0x06001749 RID: 5961 RVA: 0x0009B804 File Offset: 0x00099A04
	public Button button
	{
		get
		{
			if (this._button == null)
			{
				this._button = base.GetComponent<Button>();
			}
			return this._button;
		}
	}

	// Token: 0x17000243 RID: 579
	// (get) Token: 0x0600174A RID: 5962 RVA: 0x0009B82C File Offset: 0x00099A2C
	// (set) Token: 0x0600174B RID: 5963 RVA: 0x0009B83C File Offset: 0x00099A3C
	public bool interactable
	{
		get
		{
			return this.button.interactable;
		}
		set
		{
			this.button.interactable = value;
		}
	}

	// Token: 0x0600174C RID: 5964 RVA: 0x0009B84C File Offset: 0x00099A4C
	public void Setup(string title, MoveableThumbnailSelectUI selectUI)
	{
		this.title.text = title;
		this.selectUI = selectUI;
		this.ApplyFromSelectedData();
	}

	// Token: 0x0600174D RID: 5965 RVA: 0x0009B868 File Offset: 0x00099A68
	public void ApplyFromSelectedData()
	{
		CustomSelectSet selectedData = this.selectUI.GetSelectedData();
		this.dataName.text = ((selectedData == null) ? string.Empty : selectedData.name);
		this.thumnbnailImage.sprite = ((selectedData == null) ? null : selectedData.thumbnail_S);
	}

	// Token: 0x0600174E RID: 5966 RVA: 0x0009B8C0 File Offset: 0x00099AC0
	public void OnSelectChange()
	{
		CustomSelectSet selectedData = this.selectUI.GetSelectedData();
		this.dataName.text = ((selectedData == null) ? string.Empty : selectedData.name);
		this.thumnbnailImage.sprite = ((selectedData == null) ? null : selectedData.thumbnail_S);
	}

	// Token: 0x0600174F RID: 5967 RVA: 0x0009B918 File Offset: 0x00099B18
	public void OpenSelectUI()
	{
		if (this.selectUI != null)
		{
			this.selectUI.Open(this._button);
		}
	}

	// Token: 0x04001AF5 RID: 6901
	private Color color;

	// Token: 0x04001AF6 RID: 6902
	[SerializeField]
	private Text title;

	// Token: 0x04001AF7 RID: 6903
	[SerializeField]
	private Image thumnbnailImage;

	// Token: 0x04001AF8 RID: 6904
	[SerializeField]
	private Text dataName;

	// Token: 0x04001AF9 RID: 6905
	[SerializeField]
	private MoveableThumbnailSelectUI selectUI;

	// Token: 0x04001AFA RID: 6906
	private Button _button;
}
